package com.cangshukj.junong.service.impl;

import java.util.List;
import com.cangshukj.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.cangshukj.junong.mapper.AgencyTypeMapper;
import com.cangshukj.junong.domain.AgencyType;
import com.cangshukj.junong.service.IAgencyTypeService;

/**
 * 代理服务分类Service业务层处理
 * 
 * @author wangjie
 * @date 2025-04-01
 */
@Service
public class AgencyTypeServiceImpl implements IAgencyTypeService 
{
    @Autowired
    private AgencyTypeMapper agencyTypeMapper;

    /**
     * 查询代理服务分类
     * 
     * @param typeId 代理服务分类主键
     * @return 代理服务分类
     */
    @Override
    public AgencyType selectAgencyTypeByTypeId(String typeId)
    {
        return agencyTypeMapper.selectAgencyTypeByTypeId(typeId);
    }

    /**
     * 查询代理服务分类列表
     * 
     * @param agencyType 代理服务分类
     * @return 代理服务分类
     */
    @Override
    public List<AgencyType> selectAgencyTypeList(AgencyType agencyType)
    {
        return agencyTypeMapper.selectAgencyTypeList(agencyType);
    }

    /**
     * 新增代理服务分类
     * 
     * @param agencyType 代理服务分类
     * @return 结果
     */
    @Override
    public int insertAgencyType(AgencyType agencyType)
    {
        agencyType.setCreateTime(DateUtils.getNowDate());
        return agencyTypeMapper.insertAgencyType(agencyType);
    }

    /**
     * 修改代理服务分类
     * 
     * @param agencyType 代理服务分类
     * @return 结果
     */
    @Override
    public int updateAgencyType(AgencyType agencyType)
    {
        agencyType.setUpdateTime(DateUtils.getNowDate());
        return agencyTypeMapper.updateAgencyType(agencyType);
    }

    /**
     * 批量删除代理服务分类
     * 
     * @param typeIds 需要删除的代理服务分类主键
     * @return 结果
     */
    @Override
    public int deleteAgencyTypeByTypeIds(String[] typeIds)
    {
        return agencyTypeMapper.deleteAgencyTypeByTypeIds(typeIds);
    }

    /**
     * 删除代理服务分类信息
     * 
     * @param typeId 代理服务分类主键
     * @return 结果
     */
    @Override
    public int deleteAgencyTypeByTypeId(String typeId)
    {
        return agencyTypeMapper.deleteAgencyTypeByTypeId(typeId);
    }
}
